MenuProvider

interface MenuProvider(source)

Interface for indicating that a component will be supplying MenuItems to the component owning the app bar.

Functions

Link copied to clipboard
abstract fun onCreateMenu(@NonNull menu: @NonNull Menu, @NonNull menuInflater: @NonNull MenuInflater)
Called by the MenuHost to allow the MenuProvider to inflate MenuItems into the menu.
Link copied to clipboard
open fun onMenuClosed(@NonNull menu: @NonNull Menu)
Called by the MenuHost when the Menu is closed.
Link copied to clipboard
abstract fun onMenuItemSelected(@NonNull menuItem: @NonNull MenuItem): Boolean
Called by the MenuHost when a MenuItem is selected from the menu.
Link copied to clipboard
open fun onPrepareMenu(@NonNull menu: @NonNull Menu)
Called by the MenuHost right before the Menu is shown.